package com.example.broadcastreceiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.widget.Toast;

/**
 * author：sunweihao
 * 创建时间：2021/3/26 17:37
 * Describe：这是一个广播接收者，这里负责接收广播，并且根据广播来执行逻辑
 */
public class BootCompleteReceiver extends BroadcastReceiver {
    private static final String TAG = "BootCompleteReceiver";
    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        Log.d(TAG, "onReceive: 动作为："+action);
        Log.d(TAG, "onReceive: 开机完成");
        Toast.makeText(context, "收到开机完成的广播", Toast.LENGTH_SHORT).show();
    }
}
